import {View, Icon} from '@ant-design/react-native';
import {StyleSheet} from 'react-native';
import React from 'react';
import UnitText from '../../component/UnitText';
import ItemList from '../../component/ItemList';
const Chat = ({navigation}) => {
  const chatConfig = [
    {title: '联系我', value: '', route: '联系我', id: 0},
    {title: '聊天室', value: '', route: '聊天室', id: 1},
  ];
  return (
    <View style={styleChat.chatBox}>
      {chatConfig.map(item => (
        <View key={item!.id} style={{backgroundColor: '#fff'}}>
          <ItemList
            title={item!.title}
            onPress={() => {
              navigation.push(item!.route);
            }}>
            <View style={{display: 'flex', flexDirection: 'row'}}>
              <UnitText TStyle={{color: '#51a5f2'}}>{item?.value}</UnitText>
              <Icon
                name="arrow-right"
                size="md"
                color="#aaa"
                style={{marginLeft: 16}}
              />
            </View>
          </ItemList>
        </View>
      ))}
    </View>
  );
};
const styleChat = StyleSheet.create({
  chatBox: {
    borderRadius: 10,
    overflow: 'hidden',
    padding: 10,
  },
});
export default Chat;
